/*
   @Copyright:LeetCode
   @Author:   tjyemail
   @Problem:  http://leetcode.com/problems/isomorphic-strings
   @Language: C++
   @Datetime: 20-01-06 17:45
   */

class Solution {
public:
	bool isIsomorphic(string &s, string &t) {
		if(s.length()!=t.length()) return false;
		char maps[128]={0}, mapt[128]={0};
		for(int i=0; i<s.length(); ++i){
			if(maps[s[i]] != mapt[t[i]]) return false;
			maps[s[i]]=mapt[t[i]]=i+1;
		}
		return true;
	}
};
